package com.principle.responsibilitychain;

public class Client {
    public static void main(String[] args) {
        PurchaseRequest purchaseRequest = new PurchaseRequest(1, 1000, 1);
        Approver departmentApprover = new DepartmentApprover("张主任");
        Approver collegeApprover = new CollegeApprover("李院长");
        Approver viceSchoolMasterApprover = new ViceSchoolMasterApprover("王副校");
        ShoolMasterApprover shoolMasterApprover = new ShoolMasterApprover("刘校长");

        //需要将各个审批级别的下一个设置好(处理人构成环行)
        departmentApprover.setApprover(collegeApprover);
        collegeApprover.setApprover(viceSchoolMasterApprover);
        viceSchoolMasterApprover.setApprover(shoolMasterApprover);
        shoolMasterApprover.setApprover(departmentApprover);

        shoolMasterApprover.processRequest(purchaseRequest);
    }
}
